package cn.dgiot.fd.model;

import java.util.List;

/**
 * [场景]
 * @author
 *
 */
public class SceneRuleModel {
	/** 场景名称 */
	private String ruleName;
	/** 场景描述 */
	private String ruleDescription;
	/** 场景联动规则 */
	private RuleContent ruleContent;
	
	public String getRuleName() {
		return ruleName;
	}

	public void setRuleName(String ruleName) {
		this.ruleName = ruleName;
	}

	public String getRuleDescription() {
		return ruleDescription;
	}

	public void setRuleDescription(String ruleDescription) {
		this.ruleDescription = ruleDescription;
	}

	public RuleContent getRuleContent() {
		return ruleContent;
	}

	public void setRuleContent(RuleContent ruleContent) {
		this.ruleContent = ruleContent;
	}

	/**
	 * [场景联动规则]
	 * @author
	 *
	 */
	class RuleContent{
		/** 规则类型 当前仅支持场景联动规则，取值为IFTTT */
		private String type;
		/** 触发器 */
		private Trigger trigger;
		
		public String getType() {
			return type;
		}
		public void setType(String type) {
			this.type = type;
		}
		public Trigger getTrigger() {
			return trigger;
		}
		public void setTrigger(Trigger trigger) {
			this.trigger = trigger;
		}
	}
	
	/**
	 * [触发器]
	 * @author
	 *
	 */
	class Trigger{
		/** 节点类型 */
		private String uri;
		/** 触发器参数 */
		private TriggerParams params;
		/** 组合触发器参数 */
		private List<TriggerParams> items;
		
		class TriggerParams{
			/** 定时任务的cron表达式 */
			private String cron;
			/** cron表达式的类型 */
			private String cronType;
			/** 时区ID */
			private String timezoneID;
			/** 设备所属产品唯一标识符 */
			private String productKey;
			/** 设备名称 */
			private String deviceName;
			/** 设备属性标识符 */
			private String propertyName;
			/** 属性值比较类型 */
			private String compareType;
			/** 属性比较值 */
			private float compareValue;
			
			public String getCron() {
				return cron;
			}
			public void setCron(String cron) {
				this.cron = cron;
			}
			public String getCronType() {
				return cronType;
			}
			public void setCronType(String cronType) {
				this.cronType = cronType;
			}
			public String getTimezoneID() {
				return timezoneID;
			}
			public void setTimezoneID(String timezoneID) {
				this.timezoneID = timezoneID;
			}
			public String getProductKey() {
				return productKey;
			}
			public void setProductKey(String productKey) {
				this.productKey = productKey;
			}
			public String getDeviceName() {
				return deviceName;
			}
			public void setDeviceName(String deviceName) {
				this.deviceName = deviceName;
			}
			public String getPropertyName() {
				return propertyName;
			}
			public void setPropertyName(String propertyName) {
				this.propertyName = propertyName;
			}
			public String getCompareType() {
				return compareType;
			}
			public void setCompareType(String compareType) {
				this.compareType = compareType;
			}
			public float getCompareValue() {
				return compareValue;
			}
			public void setCompareValue(float compareValue) {
				this.compareValue = compareValue;
			}
		}
	}
}
